﻿
Imports System.Collections.ObjectModel
Imports System.Data.Common
Imports System.Collections.Generic
Imports System.Runtime.InteropServices
Imports System.Data.SqlClient
Imports System.Data
Imports Microsoft.Practices.EnterpriseLibrary.Data

Imports BusinessEntities

<Serializable()> _
Public Class ProveedorDA
    Inherits Base
    Implements iProveedorDAO

    Public Function ConsultaProveedor(ByVal strCodProveedor As String, ByVal strNombreProveedor As String) As System.Data.DataTable Implements iProveedorDAO.ConsultaProveedor
        Try
            Using command As DbCommand = Me.DataBase.GetStoredProcCommand("srt_consultaProveedor")
                Me.DataBase.AddInParameter(command, "@CodProveedor", DbType.String, strCodProveedor)
                Me.DataBase.AddInParameter(command, "@NombreProveedor", DbType.String, strNombreProveedor)


                Using ds As DataSet = Me.DataBase.ExecuteDataSet(command)
                    If ds.Tables.Count.Equals(0) Then
                        Return Nothing
                    Else
                        Return ds.Tables(0)
                    End If
                End Using
            End Using
        Catch ex As Exception
            Throw
        End Try
    End Function
End Class
